package com.ssm.apollo;

import com.alibaba.fastjson.JSONObject;
import okhttp3.*;

import java.util.List;

public class ApolloAddAdminTool {

    public static void main(String[] args) {
        String[] names = new String[]{"tangyunhui", "zhangyan03"};

        // https://apollo-portal.global-base.tc-jp1.huobiapps.com/apps/by-owner?owner=zhengshaohong&page=0&size=100
        String JSON = "[{\"name\":\"center-job\",\"appId\":\"center-job\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":792,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-11T13:41:45.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-11T13:41:45.000+0800\"},{\"name\":\"center-trade-inter\",\"appId\":\"center-trade-inter\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"tangxiangqi\",\"ownerEmail\":\"tangxiangqi@huobi.com\",\"id\":783,\"isDeleted\":false,\"dataChangeCreatedBy\":\"tangxiangqi\",\"dataChangeCreatedTime\":\"2022-06-08T18:09:50.000+0800\",\"dataChangeLastModifiedBy\":\"tangxiangqi\",\"dataChangeLastModifiedTime\":\"2022-06-08T18:09:50.000+0800\"},{\"name\":\"center-trade-manager\",\"appId\":\"center-trade-manager\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":787,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-09T20:33:26.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-09T20:33:26.000+0800\"},{\"name\":\"center-trade-order\",\"appId\":\"center-trade-order\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":793,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-11T14:17:23.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-11T14:17:23.000+0800\"},{\"name\":\"center-trade-warning\",\"appId\":\"center-trade-warning\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":794,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-11T17:31:24.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-11T17:31:24.000+0800\"},{\"name\":\"contact-canal-es-order\",\"appId\":\"contact-canal-es-order\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":822,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-20T14:27:18.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-20T14:27:18.000+0800\"},{\"name\":\"contract-canal-es-trade\",\"appId\":\"contract-canal-es-trade\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":823,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-20T14:28:18.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-20T14:28:18.000+0800\"},{\"name\":\"contract-email\",\"appId\":\"contract-email\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":796,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-12T18:07:52.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-12T18:07:52.000+0800\"},{\"name\":\"contract-index-service\",\"appId\":\"contract-index-service\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":790,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-10T10:56:39.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-10T10:56:39.000+0800\"},{\"name\":\"contract-job\",\"appId\":\"contract-job\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":771,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-06T19:30:48.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-06T19:30:48.000+0800\"},{\"name\":\"contract-manager\",\"appId\":\"contract-manager\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":781,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-08T14:32:19.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-08T14:32:19.000+0800\"},{\"name\":\"contract-phone\",\"appId\":\"contract-phone\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":795,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-11T18:01:39.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-11T18:01:39.000+0800\"},{\"name\":\"contract-risk\",\"appId\":\"contract-risk\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":782,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-08T14:33:24.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-08T14:33:24.000+0800\"},{\"name\":\"contract-sms\",\"appId\":\"contract-sms\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":797,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-12T18:21:59.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-12T18:21:59.000+0800\"},{\"name\":\"futures-center-common\",\"appId\":\"futures-center-common\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":811,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-16T17:57:31.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-16T17:57:31.000+0800\"},{\"name\":\"futures-contract-common\",\"appId\":\"futures-contract-common\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":772,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-06T19:54:04.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-06T19:54:04.000+0800\"},{\"name\":\"futures-swap-common\",\"appId\":\"futures-swap-common\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":850,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T21:15:15.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T21:15:15.000+0800\"},{\"name\":\"index-service\",\"appId\":\"index-service\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":789,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-10T10:18:36.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-10T10:18:36.000+0800\"},{\"name\":\"linear-canal-es-order\",\"appId\":\"linear-canal-es-order\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"tangxiangqi\",\"ownerEmail\":\"tangxiangqi@huobi.com\",\"id\":747,\"isDeleted\":false,\"dataChangeCreatedBy\":\"tangxiangqi\",\"dataChangeCreatedTime\":\"2022-06-01T23:21:35.000+0800\",\"dataChangeLastModifiedBy\":\"tangxiangqi\",\"dataChangeLastModifiedTime\":\"2022-06-01T23:21:35.000+0800\"},{\"name\":\"linear-canal-es-trade\",\"appId\":\"linear-canal-es-trade\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"tangxiangqi\",\"ownerEmail\":\"tangxiangqi@huobi.com\",\"id\":748,\"isDeleted\":false,\"dataChangeCreatedBy\":\"tangxiangqi\",\"dataChangeCreatedTime\":\"2022-06-01T23:26:00.000+0800\",\"dataChangeLastModifiedBy\":\"tangxiangqi\",\"dataChangeLastModifiedTime\":\"2022-06-01T23:26:00.000+0800\"},{\"name\":\"linear-swap-manager\",\"appId\":\"linear-swap-manager\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"tangxiangqi\",\"ownerEmail\":\"tangxiangqi@huobi.com\",\"id\":756,\"isDeleted\":false,\"dataChangeCreatedBy\":\"tangxiangqi\",\"dataChangeCreatedTime\":\"2022-06-01T23:36:15.000+0800\",\"dataChangeLastModifiedBy\":\"tangxiangqi\",\"dataChangeLastModifiedTime\":\"2022-06-01T23:36:15.000+0800\"},{\"name\":\"linear-swap-order\",\"appId\":\"linear-swap-order\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"tangxiangqi\",\"ownerEmail\":\"tangxiangqi@huobi.com\",\"id\":752,\"isDeleted\":false,\"dataChangeCreatedBy\":\"tangxiangqi\",\"dataChangeCreatedTime\":\"2022-06-01T23:31:50.000+0800\",\"dataChangeLastModifiedBy\":\"tangxiangqi\",\"dataChangeLastModifiedTime\":\"2022-06-01T23:31:50.000+0800\"},{\"name\":\"linear-swap-storm\",\"appId\":\"linear-swap-storm\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"tangxiangqi\",\"ownerEmail\":\"tangxiangqi@huobi.com\",\"id\":753,\"isDeleted\":false,\"dataChangeCreatedBy\":\"tangxiangqi\",\"dataChangeCreatedTime\":\"2022-06-01T23:32:58.000+0800\",\"dataChangeLastModifiedBy\":\"tangxiangqi\",\"dataChangeLastModifiedTime\":\"2022-06-01T23:32:58.000+0800\"},{\"name\":\"swap-api\",\"appId\":\"swap-api\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":839,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T14:56:13.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T14:56:13.000+0800\"},{\"name\":\"swap-canal-es\",\"appId\":\"swap-canal-es\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":888,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-07-06T17:35:25.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-07-06T17:35:25.000+0800\"},{\"name\":\"swap-dbsync\",\"appId\":\"swap-dbsync\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":845,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T17:08:06.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T17:08:06.000+0800\"},{\"name\":\"swap-email\",\"appId\":\"swap-email\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":854,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-25T19:52:49.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-25T19:52:49.000+0800\"},{\"name\":\"swap-inter\",\"appId\":\"swap-inter\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":841,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T15:13:35.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T15:13:35.000+0800\"},{\"name\":\"swap-job\",\"appId\":\"swap-job\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":838,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T14:51:59.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T14:51:59.000+0800\"},{\"name\":\"swap-manager\",\"appId\":\"swap-manager\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":836,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T14:30:15.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T14:30:15.000+0800\"},{\"name\":\"swap-order\",\"appId\":\"swap-order\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":842,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T15:14:13.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T15:14:13.000+0800\"},{\"name\":\"swap-phone\",\"appId\":\"swap-phone\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":853,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-25T19:51:03.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-25T19:51:03.000+0800\"},{\"name\":\"swap-risk\",\"appId\":\"swap-risk\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":837,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T14:40:38.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T14:40:38.000+0800\"},{\"name\":\"swap-sequence\",\"appId\":\"swap-sequence\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":846,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T17:09:08.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T17:09:08.000+0800\"},{\"name\":\"swap-settlement\",\"appId\":\"swap-settlement\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":843,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T15:14:51.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T15:14:51.000+0800\"},{\"name\":\"swap-sms\",\"appId\":\"swap-sms\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":855,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-25T19:53:09.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-25T19:53:09.000+0800\"},{\"name\":\"swap-storm\",\"appId\":\"swap-storm\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":847,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T17:10:27.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T17:10:27.000+0800\"},{\"name\":\"swap-task\",\"appId\":\"swap-task\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":840,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T15:06:57.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T15:06:57.000+0800\"},{\"name\":\"swap-trigger\",\"appId\":\"swap-trigger\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":848,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-23T17:11:03.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-23T17:11:03.000+0800\"},{\"name\":\"trade-api\",\"appId\":\"trade-api\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":776,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-07T17:22:00.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-07T17:22:00.000+0800\"},{\"name\":\"trade-dbsync\",\"appId\":\"trade-dbsync\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":818,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-17T17:56:26.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-17T17:56:26.000+0800\"},{\"name\":\"trade-inter\",\"appId\":\"trade-inter\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":778,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-07T17:23:37.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-07T17:23:37.000+0800\"},{\"name\":\"trade-notification\",\"appId\":\"trade-notification\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":785,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-09T11:30:58.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-09T11:30:58.000+0800\"},{\"name\":\"trade-order\",\"appId\":\"trade-order\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":777,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-07T17:23:03.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-07T17:23:03.000+0800\"},{\"name\":\"trade-sequence\",\"appId\":\"trade-sequence\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":791,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-10T19:46:39.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-10T19:46:39.000+0800\"},{\"name\":\"trade-settlement\",\"appId\":\"trade-settlement\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":775,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-07T17:08:08.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-07T17:08:08.000+0800\"},{\"name\":\"trade-storm\",\"appId\":\"trade-storm\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"zhengshaohong\",\"ownerEmail\":\"zhengshaohong@hnnewsoft.com\",\"id\":805,\"isDeleted\":false,\"dataChangeCreatedBy\":\"zhengshaohong\",\"dataChangeCreatedTime\":\"2022-06-15T09:40:46.000+0800\",\"dataChangeLastModifiedBy\":\"zhengshaohong\",\"dataChangeLastModifiedTime\":\"2022-06-15T09:40:46.000+0800\"},{\"name\":\"trade-task\",\"appId\":\"trade-task\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":779,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-07T17:24:29.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-07T17:24:29.000+0800\"},{\"name\":\"trade-trigger\",\"appId\":\"trade-trigger\",\"orgId\":\"R\\u0026D\",\"orgName\":\"合约研发部\",\"ownerName\":\"changhuiyong\",\"ownerEmail\":\"changhuiyong@huobi.com\",\"id\":819,\"isDeleted\":false,\"dataChangeCreatedBy\":\"changhuiyong\",\"dataChangeCreatedTime\":\"2022-06-17T18:01:45.000+0800\",\"dataChangeLastModifiedBy\":\"changhuiyong\",\"dataChangeLastModifiedTime\":\"2022-06-17T18:01:45.000+0800\"}]";

        for (String name : names) {
            List<JSONObject> objects = JSONObject.parseArray(JSON).toJavaList(JSONObject.class);
            for (JSONObject jsonObject : objects) {
                String appId = jsonObject.getString("appId");
                okhttp(appId, name);
            }
        }
    }

    private static void okhttp(String appId, String username) {
        OkHttpClient client = new OkHttpClient().newBuilder()
                .build();
        MediaType mediaType = MediaType.parse(" text/plain;charset=UTF-8");
        RequestBody body = RequestBody.create(mediaType, username);
        Request request = new Request.Builder()
                .url("http://apollo-portal.global-base.tc-jp1.huobiapps.com/apps/" + appId + "/roles/Master")
                .method("POST", body)
                .addHeader("Accept", " application/json, text/plain, */*")
                .addHeader("Accept-Encoding", " gzip, deflate")
                .addHeader("Accept-Language", " zh-CN,zh;q=0.9")
                .addHeader("Connection", " keep-alive")
                .addHeader("Content-Length", " 10")
                .addHeader("Content-Type", " text/plain;charset=UTF-8")
                .addHeader("Cookie", " sajssdk_2015_cross_new_user=1; _fbp=fb.1.1657159104425.1410255596; _gid=GA1.2.2103483622.1657159105; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2295FFC610E3FECD2F8E28F895AA5D5E5C50FA58959968D515E44C2EEB4C912463%22%2C%22first_id%22%3A%22181d660dc93638-0bba781948b0fd-1c525635-1930176-181d660dc94cb2%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22%22%7D%2C%22identities%22%3A%22eyIkaWRlbnRpdHlfY29va2llX2lkIjoiMTgxZDY2MGRjOTM2MzgtMGJiYTc4MTk0OGIwZmQtMWM1MjU2MzUtMTkzMDE3Ni0xODFkNjYwZGM5NGNiMiIsIiRpZGVudGl0eV9sb2dpbl9pZCI6Ijk1RkZDNjEwRTNGRUNEMkY4RTI4Rjg5NUFBNUQ1RTVDNTBGQTU4OTU5OTY4RDUxNUU0NEMyRUVCNEM5MTI0NjMifQ%3D%3D%22%2C%22history_login_id%22%3A%7B%22name%22%3A%22%24identity_login_id%22%2C%22value%22%3A%2295FFC610E3FECD2F8E28F895AA5D5E5C50FA58959968D515E44C2EEB4C912463%22%7D%2C%22%24device_id%22%3A%22181d660dc93638-0bba781948b0fd-1c525635-1930176-181d660dc94cb2%22%7D; memCacheAssertionID=z-zDiNV9EAPY59Zr; NG_TRANSLATE_LANG_KEY=zh-CN; _ga_J76R0D6G87=GS1.1.1657187774.3.1.1657189139.11; _ga=GA1.1.1194134347.1657159103; _c_portal=6a2792f8188ad0b65f0d480610a721d2:1657190688377; _c=dlFHtZhXiOtIxpcAClk3gAiWB2i4O7AZ; _ga_R8XL14RVYP=GS1.1.1657194375.2.1.1657194375.0")
                .addHeader("Host", " apollo-portal.global-base.tc-jp1.huobiapps.com")
                .addHeader("Origin", " http://apollo-portal.global-base.tc-jp1.huobiapps.com")
                .addHeader("Referer", " http://apollo-portal.global-base.tc-jp1.huobiapps.com/app/setting.html?")
                .addHeader("User-Agent", " Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36")
                .build();
        Response response = null;
        try {
            response = client.newCall(request).execute();
        } catch (Throwable e) {
            System.err.println(e);
        }
        System.out.println(response.body().toString());
    }
}
